# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgbase=python-python-pptx
pkgname=('python2-python-pptx' 'python-python-pptx')
_pkgname=python-pptx
pkgver=1.0.2
pkgrel=1
pkgdesc='Generate and manipulate Open XML PowerPoint (.pptx) files.'
arch=('any')
url='https://pypi.org/project/python-pptx/#files'
license=('MIT')
makedepends=('python2-setuptools' 'python-setuptools')
source=("https://files.pythonhosted.org/packages/source/${_pkgname::1}/$_pkgname/$_pkgname-$pkgver.tar.gz")
sha512sums=('c8316fc6391f66cc532f9f94d8e3f1bf52dc7b6f6063336bf98209b75ccfbe96cb4e4257292ca8fca8974a34515ecc3843ade9c69fad683a2ddf43d40acad1d5')

prepare() {
  cp -a "$_pkgname-$pkgver"{,-2}
}

build() {
  cd "$_pkgname-$pkgver-2"

  python2 setup.py build

  cd "$srcdir/$_pkgname-$pkgver"

  python setup.py build
}

package_python2-python-pptx() {
  depends=('python2' 'python2-lxml' 'python2-pillow6' 'python2-xlsxwriter')

  cd "$_pkgname-$pkgver-2"

  python2 setup.py install --prefix=/usr --root="$pkgdir" -O1 --skip-build
}

package_python-python-pptx() {
  depends=('python' 'python-lxml' 'python-pillow' 'python-xlsxwriter')

  cd "$_pkgname-$pkgver"

  python setup.py install --prefix=/usr --root="$pkgdir" -O1 --skip-build
}

